//---------------------------------------------------------------------------------
// Copyright (c) 2011, Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//---------------------------------------------------------------------------------

namespace Microsoft.ServiceBus.Samples
{
    using System;
    using System.Collections.Generic;
    using System.ServiceModel;
    using System.ServiceModel.Channels;
    using System.ServiceModel.Syndication;
    using System.ServiceModel.Web;
    
    [ServiceBehavior(Name = "SyndicationService", Namespace = "http://samples.microsoft.com/ServiceModel/Relay/")]
    class SyndicationService : SyndicationContract
    {
        public Rss20FeedFormatter GetFeed()
        {
            List<SyndicationItem> list = new List<SyndicationItem>();

            list.Add(new SyndicationItem("Day 1", "Today I woke up and went to work. It was fun.", new Uri("http://ex.azure.com/")));
            list.Add(new SyndicationItem("Day 2", "Today I was sick. I didn't go to work. Instead I stayed home and wrote code all day.", new Uri("http://ex.azure.com/")));
            list.Add(new SyndicationItem("Day 3", "This is my third entry. Using Microsoft Windows Azure is pretty cool!", new Uri("http://ex.azure.com/")));

            SyndicationFeed feed = new SyndicationFeed(
                "Microsoft Windows Azure",
                "Software+Service, what can be better",
                new Uri("http://ex.azure.com/"),
                list);

            return new Rss20FeedFormatter(feed);
        }
    }
}
